package com.baize.glinkad.bean.listener;

import com.baize.glinkad.bean.ADType;
import com.baize.glinkad.bean.Action;
import com.baize.glinkad.manager.ADManagerFactory;
import com.baize.glinkad.utils.net.ADReport;

public class RewardVideoCallBack implements RewardVideoListener {

    public RewardVideoListener listener = null;

    public RewardVideoCallBack(RewardVideoListener rewardVideoListener) {
        this.listener = rewardVideoListener;
    }

    @Override 
    public void onClicked() {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onClicked();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.CLICK);
    }

    @Override 
    public void onClose() {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onClose();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.CLOSE);
    }

    @Override 
    public void onFail(String str, String str2) {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onFail(str, str2);
        }
    }

    @Override 
    public void onReady() {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onReady();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.READY);
    }

    @Override
    public void onReward() {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onReward();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.SHOWED);
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.REWARD);
    }

    @Override 
    public void onShow() {
        RewardVideoListener rewardVideoListener = this.listener;
        if (rewardVideoListener != null) {
            rewardVideoListener.onShow();
        }
        ADReport.report(ADManagerFactory.instance().context,ADManagerFactory.instance().glinkAD.glinkConfig.getAppId(),ADManagerFactory.instance().glinkAD.posID, ADType.VIDEO, Action.SHOW);
    }
}
